﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using NetWing.Common.Data.SqlServer;

namespace NetWing.BPM.Admin.mjprint
{
    public partial class xfprint : System.Web.UI.Page
    {
        public string edNumber = "";
        public DataTable dtorderdetail = null;
        public DataTable dtfmain = null;
        public DataRow depDr = null;//获得部门信息
        public string hth = "";//合同号
        protected void Page_Load(object sender, EventArgs e)
        {
            edNumber = Request["edNumber"];

            if (!string.IsNullOrEmpty(edNumber))
            {
                string sqlfmain = "select * from MJFinanceMain where  edNumber='" + edNumber + "'";
                dtfmain = SqlEasy.ExecuteDataTable(sqlfmain);
                depDr = SqlEasy.ExecuteDataRow("select * from Sys_Departments where keyid=" + dtfmain.Rows[0]["depid"].ToString() + "");

                string sql = "select * from MJFinanceDetail where edNumber='" + edNumber + "'";
                //string orderdetailids = "";
                ////得到财务明细表
                //SqlDataReader dr = SqlEasy.ExecuteDataReader(sql);
                //while (dr.Read())
                //{
                //    orderdetailids = orderdetailids + dr["orderdetailid"].ToString() + ",";
                //}
                ////得到服务列表
                //orderdetailids = orderdetailids + "0";
                //string orderdetailsql = "select * from MJOrderDetail where keyid in(" + orderdetailids + ")";
                dtorderdetail = SqlEasy.ExecuteDataTable(sql);

                DataRow fmaindr = SqlEasy.ExecuteDataRow(sqlfmain);
                if (!string.IsNullOrEmpty(fmaindr["orderid"].ToString()))
                {
                    DataRow maindr = SqlEasy.ExecuteDataRow("select * from mjorder where keyid="+fmaindr["orderid"].ToString()+"");
                    hth = maindr["ednumber"].ToString();
                }


            }




        }
    }
}